Delete t/maint from MW. Not tests specific to MW, so I've moved them to tools/code...
authorChad Horohoe <demon@users.mediawiki.org>
Thu, 13 Aug 2009 00:12:16 +0000 (00:12 +0000)
committerChad Horohoe <demon@users.mediawiki.org>
Thu, 13 Aug 2009 00:12:16 +0000 (00:12 +0000)
t/maint/bom.t [deleted file]
t/maint/eol-style.t [deleted file]
t/maint/php-lint.t [deleted file]
t/maint/php-tag.t [deleted file]
t/maint/unix-newlines.t [deleted file]

diff --git a/t/maint/bom.t b/t/maint/bom.t
deleted file mode 100644 (file)
index b5e6ae9..0000000
+++ /dev/null
@@ -1,38 +0,0 @@
-#!/usr/bin/env perl
-#
-# This test detect Byte Order Mark (BOM). The char is sometime included at the
-# top of files by some text editors to mark them as being UTF-8 encoded.
-# They are not stripped by php 5.x and appear at the beginning of our content,
-# You want them removed!
-# See:
-#   http://www.fileformat.info/info/unicode/char/feff/index.htm
-#   http://bugzilla.wikimedia.org/show_bug.cgi?id=9954
-
-use strict;
-use warnings;
-
-use Test::More;
-
-use File::Find;
-
-# Files for wich we want to check the BOM char ( 0xFE 0XFF )
-my $ext = qr/(?:php|inc)/x ;
-
-my $bomchar = qr/\xef\xbb\xbf/ ;
-
-my @files;
-
-find( sub{ push @files, $File::Find::name if -f && /\.$ext$/ }, '.' );
-
-# Register our files with the test system
-plan tests => scalar @files ;
-
-for my $file (@files) {
-    open my $fh, "<", $file or die "Couln't open $file: $!";
-    my $line = <$fh>;
-       if( $line =~ /$bomchar/ ) {
-               fail "$file has a Byte Order Mark at line $.";
-       } else {
-               pass "$file has no Byte Order Mark!";
-       }
-}
diff --git a/t/maint/eol-style.t b/t/maint/eol-style.t
deleted file mode 100644 (file)
index 2e281dc..0000000
+++ /dev/null
@@ -1,35 +0,0 @@
-#!/usr/bin/env perl
-#
-# Based on php-tag.t
-#
-use strict;
-use warnings;
-
-use Test::More;
-use File::Find;
-use IPC::Open3;
-use File::Spec;
-use Symbol qw(gensym);
-
-my $ext = qr/(?: php | inc | txt | sql | t)/x;
-my @files;
-
-find( sub { push @files, $File::Find::name if -f && /\. $ext $/x }, '.' );
-
-plan tests => scalar @files ;
-
-for my $file (@files) {
-       open NULL, '+>', File::Spec->devnull and \*NULL or die;
-       my $pid = open3('<&NULL', \*P, '>&NULL', qw'svn propget svn:eol-style', $file);
-       my $res = do { local $/; <P> . "" };
-       chomp $res;
-       waitpid $pid, 0;
-
-       if ( $? != 0 ) {
-               pass "svn propget failed, $file probably not under version control";
-       } elsif ( $res eq 'native' ) {
-               pass "$file svn:eol-style is 'native'";
-       } else {
-               fail "$file svn:eol-style is '$res', should be 'native'";
-       }
-}
diff --git a/t/maint/php-lint.t b/t/maint/php-lint.t
deleted file mode 100644 (file)
index 6687a08..0000000
+++ /dev/null
@@ -1,33 +0,0 @@
-#!/usr/bin/env perl
-#
-# Based on php-tag.t and eol-style
-#
-use strict;
-use warnings;
-
-use Test::More;
-use File::Find;
-use IPC::Open3;
-use File::Spec;
-use Symbol qw(gensym);
-
-my $ext = qr/(?: php | inc )/x;
-my @files;
-
-find( sub { push @files, $File::Find::name if -f && /\. $ext $/x }, '.' );
-
-plan tests => scalar @files ;
-
-for my $file (@files) {
-       open NULL, '+>', File::Spec->devnull and \*NULL or die;
-       my $pid = open3('<&NULL', \*P, '>&NULL', qw'php -l', $file);
-       my $res = do { local $/; <P> . "" };
-       chomp $res;
-       waitpid $pid, 0;
-
-       if ( $? == 0 ) {
-               pass($file);
-       } else {
-               fail("$file does not pass php -l. Error was: $res");
-       }
-}
diff --git a/t/maint/php-tag.t b/t/maint/php-tag.t
deleted file mode 100644 (file)
index 5093ca7..0000000
+++ /dev/null
@@ -1,29 +0,0 @@
-#!/usr/bin/env perl
-use strict;
-use warnings;
-
-use Test::More;;
-
-use File::Find;
-use File::Slurp qw< slurp >;
-
-my $ext = qr/(?: php | inc )/x;
-
-my @files;
-find( sub { push @files, $File::Find::name if -f && /\. $ext $/x }, '.' );
-
-plan tests => scalar @files;
-
-for my $file (@files) {
-       my $cont = slurp $file;
-       if ( $cont =~ m<<\?php .* \?>>xs ) {
-               pass "$file has <?php ?>";
-       } elsif ( $cont =~ m<<\? .* \?>>xs ) {
-               fail "$file does not use <? ?>";
-       } else {
-               pass "$file has neither <?php ?> nor <? ?>, check it";
-       }
-}
-
-
-
diff --git a/t/maint/unix-newlines.t b/t/maint/unix-newlines.t
deleted file mode 100644 (file)
index c47dd17..0000000
+++ /dev/null
@@ -1,33 +0,0 @@
-#!/usr/bin/env perl
-use strict;
-use warnings;
-
-use Test::More;;
-
-use File::Find;
-use Socket '$CRLF';
-
-my $ext = qr/(?: t | pm | sql | js | php | inc | xml )/x;
-
-my @files;
-find( sub { push @files, $File::Find::name if -f && /\. $ext $/x }, '.' );
-
-plan 'no_plan';
-
-for my $file (@files) {
-    open my $fh, "<", $file or die "Can't open $file: $!";
-    binmode $fh;
-
-    my $ok = 1;
-    while (<$fh>) {
-        if (/$CRLF/) {
-            fail "$file has \\r\\n on line $.";
-            $ok = 0;
-        }
-    }
-
-    pass "$file has only unix newlines" if $ok;
-}
-
-
-